/*
 * @Author: dfh
 * @Date: 2024-10-15 17:16:38
 * @LastEditors: dfh
 * @Modified By: dfh
 * @describe: 
 */
import 'package:flutter/material.dart';
import 'package:flutter_pc_manager/config/GlobalColor.dart';

import '../../../components/icon_button_small_widget.dart';

class OrderSeach extends StatelessWidget {
  const OrderSeach({super.key});

  List<Widget> getNavWidget() {
    List<String> list = ['全部订单', '排队中', '做菜中', '出餐中', '已完成', '已取消'];
    List<Widget> widgets = [];
    for (int i = 0; i < list.length; i++) {
      widgets.add(Container(
        padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16),
        decoration: BoxDecoration(
            color: i == 0 ? GlobalColor.primaryColor : Colors.white,
            border: Border.all(
                color: const Color.fromARGB(221, 184, 182, 182), width: 1)),
        child: Text(
          list[i],
          style: const TextStyle(fontSize: 14, color: Colors.black),
        ),
      ));
    }
    return widgets;
  }

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Row(
          children: [
            ...getNavWidget(),
            Container(
              width: 250,
              height: 40,
              margin: const EdgeInsets.only(left: 30),
              child: TextField(
                onChanged: (v) {},
                decoration: const InputDecoration(
                    border: OutlineInputBorder(),
                    isDense: true,
                    contentPadding:
                        EdgeInsets.symmetric(vertical: 10.0, horizontal: 10.0),
                    hintText: '请输入订单号'),
              ),
            ),
            // ButtonSmallWidget(
            //   text: "查询",
            //   onPressed: () {
            //     onSearch(searchModel);
            //   },
            // ),
          ],
        ),
        IconButtonSmallWidget(
          width: 140,
          label: "搜索",
          iconData: Icons.search,
          onPressed: () {},
        ),
      ],
    );
  }
}
